﻿using Microsoft.Extensions.Logging;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace CronJob.Jobs
{
    public class CustomJob : IJob
    {
        private readonly ILogger<CustomJob> _logger;
        public CustomJob(ILogger<CustomJob> logger)
        {
            _logger = logger;
        }
        public Task Execute(IJobExecutionContext context)
        {
            _logger.LogInformation($"Custom job start in {DateTime.Now}");

            Thread.Sleep(3000);
            _logger.LogInformation($"Custom job end in {DateTime.Now}");
            return Task.CompletedTask;
        }
    }
}
